{{ content() }}

<div class="page-content-area">
    <div class="page-header">
        <h1>
            Video group
        </h1>
        <div class="text-right">
            {{ link_to(config.application.backendUrl ~ "/video/group/create" , "<i class='ace-icon glyphicon glyphicon-plus bigger-120'></i> Them video group", "class": "btn btn-xs btn-primary") }}
        </div>
    </div>
    <div class="widget-box form-filter">
        <div class="widget-header widget-header-small">
            <h5 class="widget-title lighter">Tìm video group</h5>
        </div>

        <div class="widget-body">
            <div class="widget-main">
                {{ form(formSearchVideoGroup.getAction() , 'class': 'form-inline' , 'method' : 'GET') }}
                <div class="form-group">
                    <div class="col-md-11">
                        <div class="form-group">
                            <div class="col-md-3 col-md-3 padding-left-none">
                                {{ text_field('id' , 'class' :'forms-control col-xs-12' , ['placeholder' : 'id']) }}
                            </div>
                            <div class="col-md-3">
                                {{ formSearchVideoGroup.render('name' , ['placeholder' : 'Tên file video group']) }}
                            </div>
                            <div class="col-md-3">
                                {{ formSearchVideoGroup.render('category_id') }}
                            </div>
                            <div class="col-md-3">
                                {{ formSearchVideoGroup.render('national_id') }}
                            </div>
                        </div>
                    </div>
                    <div class="col-md-1">
                        <button type="submit" class="btn btn-xs btn-primary btnSeachVideo" ng-click="searchVideoFile()" style="height: 30px;">Tìm</button>
                        {# link_to(config.application.backendUrl ~ "/video" , "Reset", "class": "btn btn-xs btn-default") #}
                    </div>
                    <div style="clear: both;"></div>
                </div>
                {{ end_form() }}
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="row">
                <div class="col-xs-12">
                    <div class="dataTables_wrapper form-inline no-footer">
                        <div class="row">
                            <div class="col-xs-6"></div>
                            <div class="col-xs-6">
                                <div id="sample-table-2_filter" class="dataTables_filter">
                                    <label>
                                        Search:
                                        <input type="search" class="form-control input-sm" aria-controls="sample-table-2">
                                    </label>
                                </div>
                            </div>
                        </div>
                        <table class="table table-striped table-bordered table-hover dataTable no-footer">
                            <thead>
                            <tr>
                                <th class="center">
                                    <div class="inline position-relative w40">
                                        <label class="inline middle">
                                            <input type="checkbox" class="ace checkSelectVideoGroupAll">
                                            <span class="lbl"></span>
                                        </label>
                                        <div class="inline position-relative form-group">
                                            <a href="#" data-toggle="dropdown" class="dropdown-toggle">
                                                <i class="ace-icon fa fa-caret-down bigger-125 middle"></i>
                                            </a>

                                            <ul class="dropdown-menu dropdown-lighter dropdown-100">
                                                <li>
                                                    <a id="id-select-message-all" href="#">Hoạt động</a>
                                                </li>

                                                <li>
                                                    <a id="id-select-message-none" href="#">Vô hiệu hóa</a>
                                                </li>
                                                <li>
                                                    <a id="id-select-message-none" href="#">Ẩn</a>
                                                </li>                                       
                                            </ul>
                                        </div>
                                    </div>
                                </th>
                                <th>Id</th>
                                <th>Hình ảnh</th>
                                <th>Tên</th>
                                <th>Tổng số tập</th>
                                <th>Thể loại</th>
                                <th>Quốc gia</th>
                                <th>Diễn viên</th>
                                <th>Năm sản xuất</th>
                                <th>Năm phát hành</th>
                                <th>Trạng thái</th>
                                <th>Hành động</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for group in pager %}
                                <tr>
                                    <td class="center">
                                        <label class="position-relative">
                                            <input type="checkbox" class="ace selectVideoGroup" name="selectVideoGroup[]" value="{{ group.getId() }}">
                                            <span class="lbl"></span>
                                        </label>
                                    </td>
                                    <td>{{ group.getId() }} </td>
                                    <td>
                                        {{ image(helper.getPathImageFromImageLink(group.getMainImages() , '220_124') , 'width' : '100' , 'height' : '100') }}
                                    </td>
                                    <td>
                                        {{ link_to(config.application.backendUrl ~ "/video/group/edit/" ~ group.getId() , group.videoDescription.getName() , "class": "btn btn-xs btn-info tooltip-success") }}
                                    </td>
                                    <td>{{ group.getTotalEpisode() }}</td>
                                    <td>
                                        {% if(group.videoCategoryLink) %}
                                            {% for videoCategoryLink in group.videoCategoryLink %}
                                                {{ videoCategoryLink.category.getName() ~ ' , ' }}
                                            {% endfor %}
                                        {% endif %}
                                    </td>
                                    <td>
                                        {% if(group.videoDescription.national) %}
                                        {{ group.videoDescription.national.getName() }}
                                        {% endif %}
                                    </td>
                                    <td>
                                        
                                    </td>
                                    
                                    <td>{{ group.videoDescription.getYearProduct() }}</td>
                                    <td>{{ group.videoDescription.getYearPublish() }}</td>
                                    <td>
                                        <div class="hidden-sm hidden-xs">
                                            <div class="inline position-relative">
                                                <button class="btn btn-minier btn-primary" data-toggle="dropdown" data-position="auto">
                                                    {{ helper.getStatus(group.getStatus()) }}
                                                    <i class="ace-icon fa fa-angle-down bigger-110"></i>
                                                </button>

                                                <ul class="dropdown-menu dropdown-only-icon dropdown-menu-right dropdown-caret dropdown-close">
                                                    <li>
                                                        {{ link_to(config.application.backendUrl ~ "/video/group/updateStatus?video_group_id=" ~ group.getId() ~ "&status=A" , "Hoạt động", "class": "") }}
                                                    </li>

                                                    <li>
                                                        {{ link_to(config.application.backendUrl ~ "/video/group/updateStatus?video_group_id=" ~ group.getId() ~ "&status=D" , "Vô hiệu hóa", "class": "") }}

                                                    </li>

                                                    <li>
                                                        {{ link_to(config.application.backendUrl ~ "/video/group/updateStatus?video_group_id=" ~ group.getId() ~ "&status=H", "Ẩn", "class": "") }}
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="hidden-sm hidden-xs btn-group">
                                            {{ link_to(config.application.backendUrl ~ "/video/group/edit/" ~ group.getId() , "<i class='ace-icon fa fa-pencil bigger-120'></i>", "class": "btn btn-xs btn-info tooltip-success") }}
                                            {{ link_to(config.application.backendUrl ~ "/video/group/delete/" ~ group.getId(), "<i class='ace-icon fa fa-trash-o bigger-120'></i>", "class": "btn btn-xs btn-danger tooltip-success" , "onclick" : "if(!confirm('Bạn có chắc xóa không?')){return false;};") }}
                                        </div>
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                        <div class="row">
                            <div class="col-xs-6">
                                <div class="dataTables_info" id="sample-table-2_info" role="status" aria-live="polite">

                                </div>
                            </div>
                            <div class="col-xs-6">
                                {% if pager.haveToPaginate() %}
                                    {# Render the navigation #}
                                    {{ pager.getLayout() }}
                                {% endif %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
